export const def = function(obj, key, value, enumerable) {
    Object.defineProperty(obj, key, {
        value,
        enumerable,
        writable: true,
        configurable: true
    })
}

export function parsePath(str) {
    var parts = str.split('.');
    return (obj) => {
        for (let i = 0; i < parts.length; i++) {
            if (!obj) return;
            obj = obj[parts[i]];
        }
        return obj;
    }
}